package study.week05.autoconfig;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import study.week05.entity.Student;

@Configuration
public class ProfileBeanConfig {

    @Bean
    public Student studentBase(){
        Student stu = new Student();
        stu.setAge(18);
        stu.setStudentName("测试学生");
        return stu;
    }

    @Profile("test")
    @Bean
    public Student studentProfile(){
        Student stu = new Student();
        stu.setAge(18);
        stu.setStudentName("test环境才有的测试学生");
        return stu;
    }


}
